#!/bin/sh

#CB=${BATCH_HOME}/framework/classes/
CB=${BATCH_HOME}/lib/fwBase.jar
CODEBASE=file://${CB}
POLICY=${BATCH_HOME}/sh/.java.policy
CP=${BATCH_HOME}/lib/log4j-1.2.16.jar

cd ${BATCH_HOME}

${JAVA_HOME}/bin/java -cp ${CP} org.apache.log4j.net.SimpleSocketServer 20001 ${BATCH_HOME}/classes/log4jServer.xml &

sleep 3

${JAVA_HOME}/bin/rmiregistry 20000 &

export PATH=${BATCH_HOME}/sh:${PATH}

CP=${BATCH_HOME}/classes:${CP}:${CB}:${BATCH_HOME}/lib/commons-logging-1.1.1.jar:${BATCH_HOME}/lib/postgresql-9.0-801.jdbc4.jar

${JAVA_HOME}/bin/java -cp ${CP} -Djava.rmi.server.hostname=${HOSTNAME} -Djava.rmi.server.codebase=${CODEBASE} -Djava.security.policy=${POLICY} -Dlog4j.configuration=file:${BATCH_HOME}/classes/log4jJM.xml batch.controller.JobManagerImpl &

unset CB
unset CP
unset CODEBASE
unset POLICY
